home *** CD-ROM | disk | FTP | other *** search
/ Atlas of Florida / Atlas of Florida.iso / Movies / 1.0 Introduction / 1.0 Introduction / 00244_Script_244 < prev    next >
Text File  |  1994-08-23  |  9KB  |  246 lines

  1. -- Weight (Wgt) return text popUp menu
  2.  
  3. on AlphabetMenuWgt    --  a pop up menu returning item text
  4.   global  PopAlphaWgt
  5.   
  6.   --  dispose of any previous instances, if any
  7.   if objectP( PopAlphaWgt ) then PopAlphaWgt( mDispose )
  8.   set menuListWgt = the text of cast "WgtMenList1"
  9.   --  Be sure to set parameter itemNum for PopNum or PopText to zero.
  10.   set PopAlphaWgt = PopMenu(mNew,menuListWgt, 216)
  11.   
  12.   if not objectP( PopAlphaWgt ) then 
  13.     alert "PopMenu Object not made: " & string( PopAlphaWgt )
  14.   end if
  15.   
  16.   --  to set automatic remembering of last item selected
  17.   PopAlphaWgt(mSmart, 1 )
  18.   
  19.   --  PopMenu uses screen co÷rdinates, which must be changed
  20.   --  to window co÷rdinates with the StageLeft & stageTop functions
  21.   set sH = the left of sprite 18 + the stageLeft + 1
  22.   set sV = the top of sprite 18 + the stageTop + 1
  23.   
  24.   set result = PopAlphaWgt(mPopText, sH, sV, 0)
  25.   if string( result ) = "" then exit
  26.   else set the text of cast "WgtMen1" to "   " & string( result )
  27.   
  28.   MakeConversionWgt
  29.   
  30.   -- dispose of this menu
  31.   if objectP( PopAlphaWgt ) then PopAlphaWgt( mDispose )
  32.   
  33. on AlphabetMenu2Wgt    --  a pop up menu returning item text
  34.   global  PopAlpha2Wgt
  35.   --  dispose of any previous instances, if any
  36.   if objectP( PopAlpha2Wgt ) then PopAlpha2Wgt( mDispose )
  37.   set menuListWgt = the text of cast "WgtMenList2"
  38.   --  Be sure to set parameter itemNum for PopNum or PopText to zero.
  39.   set PopAlpha2Wgt = PopMenu(mNew,menuListWgt, 216)
  40.   
  41.   if not objectP( PopAlpha2Wgt ) then 
  42.     alert "PopMenu Object not made: " & string( PopAlpha2Wgt )
  43.   end if
  44.   
  45.   --  to set automatic remembering of last item selected
  46.   PopAlpha2Wgt(mSmart, 1 )
  47.   
  48.   --  PopMenu uses screen co÷rdinates, which must be changed
  49.   --  to window co÷rdinates with the StageLeft & stageTop functions
  50.   set sH = the left of sprite 21 + the stageLeft + 1
  51.   set sV = the top of sprite 21 + the stageTop + 1
  52.   
  53.   set result = PopAlpha2Wgt(mPopText, sH, sV, 0)
  54.   if string( result ) = "" then exit
  55.   else set the text of cast "WgtMen2" to "   " & string( result )
  56.   
  57.   MakeConversionWgt
  58.   
  59.   -- dispose of this menu
  60.   if objectP( PopAlpha2Wgt ) then PopAlpha2Wgt( mDispose )
  61.   
  62.   
  63. on MakeConversionWgt -- does conversion based on the menus and the entered value
  64.   showChannel 20
  65.   -- hide other answers
  66.   hideChannel 8
  67.   hideChannel 14
  68.   
  69.   
  70.   put string(the text of cast "WgtMen1") into menu1Wgt
  71.   put string(the text of cast "WgtMen2") into menu2Wgt
  72.   put value(the text of cast "WgtValue") into cValueWgt -- entered by user
  73.   
  74.   put "?" into field "AnswerWgt"
  75.   
  76.   if menu1Wgt =  "     oz" then 
  77.     if menu2Wgt =  "     oz" then
  78.       put cValueWgt into field "AnswerWgt"
  79.       put cValueWgt into field "AnswerString"
  80.     end if
  81.     if menu2Wgt =  "     lb" then
  82.       put ( cValueWgt / 16.0) into field "AnswerWgt"
  83.       put cValueWgt & " / 16" into field "AnswerString"
  84.     end if
  85.     if menu2Wgt =  "     ton" then
  86.       put ( cValueWgt / 16.0 / 2000.0 ) into field "AnswerWgt"
  87.       put "( " & cValueWgt & " / 16 ) / 2,000" into field "AnswerString"
  88.     end if
  89.     if menu2Wgt =  "     g" then
  90.       put ( cValueWgt * 28.3495 ) into field "AnswerWgt"
  91.       put cValueWgt & " * 28.3495" into field "AnswerString"
  92.     end if
  93.     if menu2Wgt =  "     kg" then
  94.       put ( cValueWgt * 28.3495 ) / 1000.0 into Field "AnswerWgt"
  95.       put "( " & cValueWgt & " * 28.3495 ) / 1,000" into field "AnswerString"
  96.     end if
  97.     if menu2Wgt =  "     m ton" then
  98.       put ( cValueWgt * 28.3495 ) / 1000.0 / 1000.0 into Field "AnswerWgt"
  99.       put "( ( " & cValueWgt & " * 28.3495 ) / 1,000 ) / 1,000" into field "AnswerString"
  100.     end if
  101.   end if
  102.   
  103.   if menu1Wgt =  "     lb" then 
  104.     if menu2Wgt =  "     oz" then
  105.       put cValueWgt * 16.0 into field "AnswerWgt"
  106.       put cValueWgt & " * 16" into field "AnswerString"
  107.     end if
  108.     if menu2Wgt =  "     lb" then
  109.       put cValueWgt into field "AnswerWgt"
  110.       put cValueWgt into field "AnswerString"
  111.     end if
  112.     if menu2Wgt =  "     ton" then
  113.       put ( cValueWgt / 2000.0 ) into field "AnswerWgt"
  114.       put cValueWgt & " / 2,000" into field "AnswerString"
  115.     end if
  116.     if menu2Wgt =  "     g" then
  117.       put ( cValueWgt * 453.59 ) into field "AnswerWgt"
  118.       put cValueWgt & " * 453.59" into field "AnswerString"
  119.     end if
  120.     if menu2Wgt =  "     kg" then
  121.       put ( cValueWgt * 453.59 ) / 1000.0 into Field "AnswerWgt"
  122.       put "( " & cValueWgt & " * 453.59 ) / 1,000" into field "AnswerString"
  123.     end if
  124.     if menu2Wgt =  "     m ton" then
  125.       put ( cValueWgt * 453.59 ) / 1000.0 / 1000.0 into Field "AnswerWgt"
  126.       put ( ( " & cValueWgt & " * 453.59 ) / 1,000 ) / 1,000" into field "AnswerString"
  127.     end if
  128.   end if
  129.   
  130.   if menu1Wgt =  "     ton" then 
  131.     if menu2Wgt =  "     oz" then
  132.       put cValueWgt * 2000.0 * 16.0 into field "AnswerWgt"
  133.       put "( " & cValueWgt & " * 2,000 ) * 16" into field "AnswerString"
  134.     end if
  135.     if menu2Wgt =  "     lb" then
  136.       put cValueWgt * 2000.0 into field "AnswerWgt"
  137.       put cValueWgt & " * 2,000" into field "AnswerString"
  138.     end if
  139.     if menu2Wgt =  "     ton" then
  140.       put ( cValueWgt ) into field "AnswerWgt"
  141.       put cValueWgt into field "AnswerString"
  142.     end if
  143.     if menu2Wgt =  "     g" then
  144.       put ( cValueWgt * 907.18 ) * 1000.0 into field "AnswerWgt"
  145.       put "( " & cValueWgt & " * 907.18 ) * 1,000" into field "AnswerString"
  146.     end if
  147.     if menu2Wgt =  "     kg" then
  148.       put ( cValueWgt * 907.18 )  into Field "AnswerWgt"
  149.       put cValueWgt & " * 907.18" into field "AnswerString"
  150.     end if
  151.     if menu2Wgt =  "     m ton" then
  152.       put ( cValueWgt * 907.18 ) / 1000.0  into Field "AnswerWgt"
  153.       put "( " & cValueWgt & " * 907.18 ) / 1,000" into field "AnswerString"
  154.     end if
  155.   end if
  156.   
  157.   if menu1Wgt =  "     g" then 
  158.     if menu2Wgt =  "     oz" then
  159.       put (cValueWgt * 0.035274) into field "AnswerWgt"
  160.       put cValueWgt & " * .035274" into field "AnswerString"
  161.     end if
  162.     if menu2Wgt =  "     lb" then
  163.       put (cValueWgt * 0.035274) / 16.0 into field "AnswerWgt"
  164.       put "( " & cValueWgt & " * .035274 ) / 16" into field "AnswerString"
  165.     end if
  166.     if menu2Wgt =  "     ton" then
  167.       put (cValueWgt * 0.035274) / 16.0 / 2000.0 into field "AnswerWgt"
  168.       put "( ( " & cValueWgt & " * .035274 ) / 16 ) / 2,000" into field "AnswerString"
  169.     end if
  170.     if menu2Wgt =  "     g" then
  171.       put cValueWgt into field "AnswerWgt"
  172.       put cValueWgt into field "AnswerString"
  173.     end if
  174.     if menu2Wgt =  "     kg" then
  175.       put ( cValueWgt / 1000.0 )  into Field "AnswerWgt"
  176.       put cValueWgt & "/ 1,000" into field "AnswerString"
  177.     end if
  178.     if menu2Wgt =  "     m ton" then
  179.       put ( cValueWgt / 1000.0 ) / 1000.0  into Field "AnswerWgt"
  180.       put "( " & cValueWgt & " / 1,000 ) / 1,000" into field "AnswerString"
  181.     end if
  182.   end if
  183.   
  184.   if menu1Wgt =  "     kg" then 
  185.     if menu2Wgt =  "     oz" then
  186.       put (cValueWgt * 2.2046) * 16.0 into field "AnswerWgt"
  187.       put "( " & cValueWgt & " * 2.2046 ) * 16" into field "AnswerString"
  188.     end if
  189.     if menu2Wgt =  "     lb" then
  190.       put (cValueWgt * 2.2046) into field "AnswerWgt"
  191.       put cValueWgt & " * 2.2046" into field "AnswerString"
  192.     end if
  193.     if menu2Wgt =  "     ton" then
  194.       put (cValueWgt * 2.2046) / 2000.0 into field "AnswerWgt"
  195.       put "( " & cValueWgt & " * 2.2046 ) / 2,000" into field "AnswerString"
  196.     end if
  197.     if menu2Wgt =  "     g" then
  198.       put cValueWgt * 1000.0 into field "AnswerWgt"
  199.       put cValueWgt & " * 1,000" into field "AnswerString"
  200.     end if
  201.     if menu2Wgt =  "     kg" then
  202.       put ( cValueWgt)  into Field "AnswerWgt"
  203.       put cValueWgt into field "AnswerString"
  204.     end if
  205.     if menu2Wgt =  "     m ton" then
  206.       put ( cValueWgt / 1000.0 )  into Field "AnswerWgt"
  207.       put cValueWgt & " / 1,000" into field "AnswerString"
  208.     end if
  209.   end if
  210.   
  211.   if menu1Wgt =  "     m ton" then 
  212.     if menu2Wgt =  "     oz" then
  213.       put (cValueWgt * 2204.6) * 16.0 into field "AnswerWgt"
  214.